package kr.bae.androidcomplete02.ch15;

import kr.bae.androidcomplete02.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.widget.TextView;

public class DisplayMetrixEx extends Activity {
	StringBuilder sb;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.displaymatrix);
		
		sb = new StringBuilder();
		DisplayMetrics dm = getResources().getDisplayMetrics();
		sb.append("widthPixels=");
		sb.append(dm.widthPixels);
		sb.append("\nheightPixels=");
		sb.append(dm.heightPixels);
		sb.append("\ndensityDpi");
		sb.append(dm.densityDpi);
		sb.append("\ndensity=");
		sb.append(dm.density);
		sb.append("\nscaledDensity=");
		sb.append(dm.scaledDensity);
		sb.append("\nxdpi=");
		sb.append(dm.xdpi);
		sb.append("\nydpi=");
		sb.append(dm.ydpi); 
		
		TextView tv = (TextView) findViewById(R.id.ch15_display_text);
		tv.setText(sb);
	}
}
